#!/bin/bash

current_path=$(pwd)

# loop all subdir under src
for dir in ${current_path}/src/*/
do
    dir=${dir%*/}      # remove the trailing "/"
    echo "build ${dir}"  # print everything after the final "/"

    cd "${dir}"
    rm -rf build
    mkdir build && cd build && cmake .. && make
    cd -
done
